import React, { memo } from "react";
import PropTypes from "prop-types";
import SectionRoomsWrapper from "./style";
import RoomItem from "../room-item";
const SectionRooms = memo(function SectionRooms(props) {
  const { roomList = [], itemWidth } = props;
  console.log("itemWidth", itemWidth);
  return (
    <SectionRoomsWrapper>
      <div className="list">
        {roomList?.slice(0, 8).map((item, index) => {
          return (
            <RoomItem key={item.name} roomObj={item} itemWidth={itemWidth} />
          );
        })}
      </div>
    </SectionRoomsWrapper>
  );
});

SectionRooms.propTypes = {
  roomList: PropTypes.array,
};

export default SectionRooms;
